package com.demo.service.impl;

import com.demo.dao.StageDao;
import com.demo.dto.StageDto;
import com.demo.pojo.Stage;
import com.demo.service.StageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @ClassName StageServiceImpl
 * @Description TODO
 * @Author Windy
 * @Date 2022/9/2 16:53
 * @Version 1.0
 **/
@Service
//@Transactional
public class StageServiceImpl implements StageService {
    @Autowired
    StageDao stageDao;
    @Override
    public StageDto findStageById(String id) {
        return stageDao.findStageById(id);
    }

    @Override
    public StageDto findStageByName(String name) {
        return stageDao.findStageByName(name);
    }

    @Override
    public boolean deletedStage(Stage stage) {
        return stageDao.deletedStage(stage)>=0;
    }

    @Override
    public boolean updateStageById(Stage stage) {
        return stageDao.updateStageById(stage) >= 0;
    }

    @Override
    public boolean insertStage(Stage stage) {
        return stageDao.insertStage(stage) >= 0;
    }

    @Override
    public List<StageDto> findAll() {
        return stageDao.findAll();
    }
}
